//
//  WmcCloudSearchPhotoFooterView.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/3/31.
//

import UIKit

class WmcCloudSearchPhotoFooterView: WmcBaseView {
    // Internal

    var queryClosure: (() -> Void)?

    override func makeUI() {
        backgroundColor = .wmc_grayH19_F5F5F5

        addSubview(submitBtn)
        submitBtn.snp.makeConstraints { make in
            make.bottom.equalToSuperview()
            make.left.equalTo(Wmc_standardEdge.left)
            make.right.equalTo(-Wmc_standardEdge.right)
            make.height.equalTo(44)
        }
    }

    override func bindViewAction() {
        submitBtn.yp.addEvent { [weak self] _ in
            guard let weakSelf = self else { return }
            weakSelf.queryClosure?()
        }
    }

    // Private

    private lazy var submitBtn: UIButton = {
        let btn = UIButton.Wmc_themeColorBtn(color: .wmc_mainTheme, title: "查找照片")
        return btn
    }()
}
